//
// Created by LiuYou on 2021/8/2.
//




#ifndef LINUXENVIRONMENTPROGRAMMING_MYPIPE_HPP
#define LINUXENVIRONMENTPROGRAMMING_MYPIPE_HPP


#include <cstdlib>


#define PIPE_SIZE           1024
#define MY_PIPE_READ        0x00000001UL
#define MY_PIPE_WRITE       0x00000002UL


using MyPipe = void;

MyPipe* myPipeInit();

int myPipeDestroy(MyPipe* myPipe);

int myPipeRead(MyPipe* myPipe, void* buf, size_t count);

int myPipeWrite(MyPipe* myPipe, const void* buf, size_t count);

int myPipeRegister(MyPipe* myPipe, int optionMap);

int myPipeUnregister(MyPipe* myPipe, int optionMap);


#endif //LINUXENVIRONMENTPROGRAMMING_MYPIPE_HPP
